<template>
  <div>
    <div>
      <CloudBadge :count="count">
        <a href="#" class="head-example" />
      </CloudBadge>
      <CloudButtonGroup>
        <CloudButton @click="decline">
          <CloudIcon type="minus" />
        </CloudButton>
        <CloudButton @click="increase">
          <CloudIcon type="plus" />
        </CloudButton>
      </CloudButtonGroup>
    </div>
    <div style="margin-top: 10px">
      <CloudBadge :dot="show">
        <a href="#" class="head-example" />
      </CloudBadge>
      <CloudSwitch v-model="show" />
    </div>
  </div>
</template>

<script>
  export default {
    title: '7.动态',
    subTitle: '展示动态变化的效果。',
    data () {
      return {
        count: 5,
        show: true,
      }
    },
    methods: {
      decline () {
        let count = this.count - 1;
        if (count < 0) {
          count = 0;
        }
        this.count = count;
      },
      increase () {
        this.count++;
      }
    }
  }
</script>

<style lang="scss">
</style>